Repository navigation
A task's instructions as a tab: openFile, read-only Markdown as a page - #39
Merged
Merged
Conversation
Share links can name the tab to open with ("openFile", e.g. a task's
aufgabe.md); the tab's project, «Teilen», a reload and the ZIP keep it,
and it follows a rename. ▶, Tests and Visualisieren act on mainFile,
whichever tab is open. Markdown files get the workspace's page view
(glpython-editor#55) through renderMarkdown: marked + DOMPurify,
pinned; HTML in the Markdown shows as text, links open in a new tab.
Checks in test:browser: a task link (opens on aufgabe.md as a page, the
buttons act on auswerter.py, read-only, «Teilen» and reload keep it),
an old link, and sanitizing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A library by URL named as openFile (e.g. aufgabe.md, for a shorter hand-in link) becomes the open tab once fetched, unless the learner has chosen a tab meanwhile; one that fails leaves mainFile open. A read-only .md by URL opens as the page. The tabs follow the files' order in the link (fileOrder on the tab's project), and «Teilen» writes them in that order. glpython-editor at v0.1.29 (#55). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P45: a task's instructions as a tab in an IDE project. A link opens on
aufgabe.md, read-only and shown as a page, next to the code.Installs glpython-editor v0.1.29 (#55: the page view, and «Visualisieren» with another tab open).
What it does
"openFile"next tomainFile, in any link version.mainFileas before. AnopenFilethat isn't among the files is ignored, and an IDE from before opens such a link as it did.glpython.json) and a ZIP import. It follows a rename, and a delete drops it.openFilecan name a file loaded by URL (a shorter hand-in link: 1,973 instead of 3,606 characters). That tab becomes the open one as soon as it has loaded, unless the learner has chosen a tab in the meantime. If it fails,mainFilestays open. A read-only.mdby URL opens as the page.aufgabe.mdcan come first. «Teilen» writes the files in that order, and a new file comes last.mainFile, whichever tab is open. ▶ and «Tests» already did. «Visualisieren» ranmainFilebut drew an empty view with another tab open; glpython-editor#55 fixes that.readOnly: trueon a file withcodealready worked, and is now checked:.mdtab gets Ansicht / Text at the end of the tabs. A read-only file opens as the page, an editable one as its text.marked18.1.1 withDOMPurify3.4.17, both pinned exactly. I took the newestmarkedthat's at least two weeks old, since 18.1.3 is four days old.htmlrenderer escapes it), and DOMPurify sanitizes the result. Links gettarget="_blank"andrel="noopener noreferrer".The fields (for your link script)
As
?project=(or#project=beyond 8,192 characters) +LZString.compressToEncodedURIComponent(JSON.stringify(payload)):{ "v": 2, "name": "Etappe 4: Auswerter", "mainFile": "auswerter.py", "openFile": "aufgabe.md", "files": { "aufgabe.md": { "path": "aufgabe.md", "url": "https://…/aufgabe.md", "readOnly": true }, "parser.py": { "path": "parser.py", "url": "https://…/parser.py", "readOnly": true }, "auswerter.py": { "path": "auswerter.py", "label": "auswerter.py", "kind": "python", "code": "…" } } }aufgabe.mdcan also carry its code ("kind": "text", "code": "…", "readOnly": true); then it is open at once.v: 2 because of the library by URL; a link without libraries can stay at 1.kind:"text"for the Markdown file.openFile: a key offiles.Checks (
test:browser, all 18 pass)New cases:
auswerter.pymain,bib.pyby URL,aufgabe.mdwith code, read-only,openFile):aufgabe.mdas a page, with the heading, table, code block and link (_blank,noopener noreferrer);aufgabe.mdopen, ▶ printsauswerter.py's output, «Tests» runs its doctest, and «Visualisieren» showsauswerter.py.openFile,mainFile,aufgabe.mdwithreadOnly: trueand its code, andbib.pyby URL;readOnly.aufgabe.mdfirst in the link, served by the check):aufgabe.mdas a page once it has loaded;aufgabe.md,bib.py,auswerter.py, in the link's order;openFile, the order and the URL, and so does a reload.auswerter.pyuntil it has loaded. The learner opensbib.py, andaufgabe.mdarriving doesn't take the tab.auswerter.pystays open, with the notice.main.py(an unknownopenFileis ignored), and an editable.mdopens as text.<script>,<img onerror>, ajavascript:link andonclickdo nothing. The HTML shows as text, no such element or attribute remains, the link has nohref, and clicking it sets nothing.Lint passes (only the existing warnings in
coi-serviceworker.js), and so does the build.THIRD_PARTY_NOTICES.mdnow listsmarked(MIT) and DOMPurify (Apache-2.0, of MPL-2.0 OR Apache-2.0).Manual tests
Desktop (Chrome, Safari, Firefox), with a task link:
aufgabe.mdas a page with «Ansicht» pressed.aufgabe.mdopen: they all act onauswerter.py.auswerter.py, «Teilen», then open the copied link in a new tab: it opens onaufgabe.md, with the edit.aufgabe.mdis read-only and open at the start.iPad (portrait and landscape), with an external keyboard:
auswerter.py.Follow-ups (not done)
aufgabe.mdby URL under «Bibliotheken» (now with the book icon). For instructions, another heading, e.g. «Geladene Dateien», might read better.markedand DOMPurify, plus the editor changes since v0.1.27). They could be loaded only when a Markdown file opens.🤖 Generated with Claude Code